<script type="text/javascript" src="<?=APPLICATION_SITEADMIN_URL?>fckeditor/fckeditor.js"></script>
<script type="text/javascript" src="<?=APPLICATION_SITEADMIN_URL?>fckeditor/ewp.js"></script>
<script type="text/javascript">
<!--
	_width_multiplier = 16;
	_height_multiplier = 30;
	var EW_DHTMLEditors = [];
	function EW_UpdateTextArea() {
		if (typeof EW_DHTMLEditors != 'undefined') {
			if (FCKeditorAPI) {
				var inst;			
				for (inst in FCKeditorAPI.__Instances)
					FCKeditorAPI.__Instances[inst].UpdateLinkedField();
			}
		}
	}

//-->
</script>


<?
	$mod = $_GET['mod'];
	if(isset($_GET['id'])) $id = $_GET['id'];
	else $id = 1;
	
	$db = new MySQL();
	$table = "catalog";
	$sql = $db->select("select * from $table where id='$id'");
	if ($db->numrows($sql)>0)	
	$te = $db->fetch($sql);
	$db->close();
	$title_add = 'Edit "Catalog"';
?>
<script type="text/JavaScript">
		
	function save(id)
	{
		var frm=document.frmedit;		
		
			frm.action="?mod=<?=$mod?>&act=process&id="+id;
			frm.method="POST";
			frm.submit();
		
	}
	
	function resetfrom()
	{
	   document.frmedit.reset();
	   
	}
	
	
	
	
</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
	  <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="34"><img src="<?=APPLICATION_SITEADMIN_URL?>images/cor_data_top_l.gif" alt="tl" width="34" height="19" /></td>
			<td class="toptborder">&nbsp;</td>
			<td width="20"><img src="<?=APPLICATION_SITEADMIN_URL?>images/cor_data_top_r.gif" alt="tr" /></td>
		  </tr>
	  </table></td>
	</tr>
	<tr>
	  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="10" class="leftborder">&nbsp;</td>
			<td><table width="100%" border="0" cellpadding="0" cellspacing="2" class="dataBack">
			  <tr>
				<td width="55%" height="36" class="titleOrange"><?=$title_add?></td>
				<td align="right" valign="middle" class="titleOrange">&nbsp;</td>
			  </tr>
			  <tr>
				<td height="7" colspan="2" background="images/cor_data_line1.gif"></td>
			  </tr>
			  <tr>
				<form name="frmedit" method="post" enctype="multipart/form-data" >
				<td  colspan="2" ><table width="100%" border="0" cellspacing="0">				 
				  <tr>
					<td width="19%" align="right" valign="top"> File PDF: </td>
					<td ><input type="file" name="filename" />
					<?php
						if($te['filename']!="" && file_exists("../catalog/".$te['filename']))
						{
							echo '<br/>'.$te['filename'];
						}
					?></td>
				  </tr> 
				  <tr>
				    <td align="right" valign="top">Link to : </td>
				    <td ><input name="linkto" type="text" class="form_0" value="<?=$te['linkto']?>" ></td>
				  </tr>	 
				  <tr>
				    <td align="right" valign="top">Type : </td>
				    <td ><input name="typeshow" type="radio" value="0" checked />File PDF  <input name="typeshow" type="radio" value="1" <?php if($te['typeshow']==1) echo 'checked'; ?> />Link</td>
				  </tr>	
				  
				  <tr>
					<td height="35" align="right" valign="top">&nbsp;</td>
					<td align="left" valign="middle"><img src="images/icons/save.png" onClick="save(<?=$id?>);" class="pointer" />  &nbsp;
					<img src="images/icons/reset.png" onClick="resetfrom();" class="pointer" /></td>
				  </tr>
				</table>
				<input type="hidden" name="form_" value="edit">
				</td>
				</form>
			 </tr>
		   </table>
		   </td>
		   <td width="10" class="rightborder">&nbsp;</td>
		 </tr>
	  </table></td>
	</tr>
	<tr>
	  <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataBack">
		  <tr>
			<td width="34"><img src="<?=APPLICATION_SITEADMIN_URL?>images/cor_data_bot_l.gif" alt="bl" /></td>
			<td class="botborder" >&nbsp;</td>
			<td width="19"><img src="<?=APPLICATION_SITEADMIN_URL?>images/cor_data_bot_r.gif" alt="br" /></td>
		  </tr>
	  </table></td>
	</tr>
</table>
<script type="text/javascript">
<!--
	EW_createEditor();  // Create DHTML editor(s)

//-->
</script>

